// 面包屑
import Breadcrumb from './components/breadcrumb/index.js'

// 对话框
import Dialog from './components/dialog/index.js'

// 空数据展示
import Empty from './components/empty/index.js'

// 列表头部
import ListHeader from './components/list-header/index.js'

// 更多按钮
import MoreBtn from './components/more-btn/index.js'

// 卡片
import PageCard from './components/page-card/index.js'

// 页面标题
import PageTitle from './components/page-title/index.js'

// TAB切换
import Tab from './components/tab/index.js'

// 表格
import Table from './components/table/index.js'

// 标签
import Tag from './components/tag/index.js'

// 详情表单页
import DetailForm from './components/detail-form/index.js'

// 省市级联选择
import Region from './components/region/index.js'

// 上传文件
import UploadFile from './components/upload-file/index.js'

// 上传图片
import UploadImage from './components/upload-image/index.js'

///自定义指令
// 自定义鉴权指令
// import auth from './directives/auth'

///全局mixin混入
import mixin from './mixins/index'

if (typeof window !== 'undefined' && window.Vue) {
  window.Vue.use(install)
}

function install(Vue) {
  //全局mixin混入
  Vue.mixin(mixin)

  //公共组件
  Vue.component('f-breadcrumb', Breadcrumb)
  Vue.component('f-dialog', Dialog)
  Vue.component('f-tab', Tab)
  Vue.component('f-empty', Empty)
  Vue.component('f-list-header', ListHeader)
  Vue.component('f-more-btn', MoreBtn)
  Vue.component('f-card', PageCard)
  Vue.component('f-title', PageTitle)
  Vue.component('f-table', Table)
  Vue.component('f-tag', Tag)
  Vue.component('f-detail-form', DetailForm)
  Vue.component('f-region', Region)
  Vue.component('f-upload-file', UploadFile)
  Vue.component('f-upload-image', UploadImage)
}

export default {
  install,
  Breadcrumb,
  Dialog,
  Tab,
  Empty,
  ListHeader,
  MoreBtn,
  PageCard,
  PageTitle,
  Table,
  Tag,
  DetailForm,
  Region,
  UploadImage,
  UploadFile
}
